package com.csi.config;

import jakarta.ejb.TransactionManagement;
import org.springframework.context.annotation.*;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.sql.DataSource;

@TransactionManagement
@EnableAspectJAutoProxy
@EnableScheduling
@Configuration
@Import({DataSourceConfig.class, MybatisConfig.class,RedisConfig.class})
@ComponentScan(value={"com.csi.service","com.csi.mapper"})
public class ServiceJavaConfig {
    @Bean
    public DataSourceTransactionManager dataSourceTransactionManager(DataSource dataSource) {
        DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
        dataSourceTransactionManager.setDataSource(dataSource);
        return dataSourceTransactionManager;
    }
}
